home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1986 March / Ahoy_Magazine_86-03_1986_Double_L.d64 / quiz maker (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  4KB  |  98 lines

  1. 1 rem *** quiz maker ***
  2. 2 rem use this to generate quiz data files for "the most and the least"
  3. 3 rem (in direct mode, type 'poke 53265,peek(53265)or 64' to make shifted
  4. 4 rem characters show up when typing them in
  5. 8 rem ** open quiz file
  6. 9 rem * change the name for each new quiz file you create
  7. 10 ff$="quiz matrix"
  8. 11 ff$="@0:q "+left$(ff$,14)+",s,w"
  9. 12 open 2,8,2,ff$
  10. 14 rem * prepare carriage return variable
  11. 15 z$=chr$(13)
  12. 16 rem * select extended background color mode
  13. 17 poke 53265,peek(53265)or 64
  14. 18 rem ** read quiz data and print it to file
  15. 19 rem * how many quizzes?
  16. 20 nq=2:print#2,nq
  17. 28 rem ** main loop for all quizzes **
  18. 29 rem * read total number of entries in this quiz
  19. 30 for i=1 to nq:read tn:print#2,tn
  20. 31 rem * colors for backgrounds 0-3
  21. 32 for j=0 to 3:read a:print#2,a:poke 53281+j,a:next:poke 53280,peek(53281)
  22. 33 rem * colors for foregrounds 0-3
  23. 34 for j=0 to 3:read fc$(j):print#2,fc$(j):next
  24. 35 rem * quiz title line & format/instruction line
  25. 36 read a$,b$:a$=fc$(3)+a$:b$=fc$(0)+b$:print#2,a$z$b$:print"[147]"a$:print b$
  26. 37 rem * column headers
  27. 38 read a$,b$:a$=fc$(1)+a$:b$=fc$(1)+b$:print#2,a$z$b$:print a$b$
  28. 39 rem ** loop for each quiz **
  29. 40 for j=1 to tn
  30. 41 rem * get entry & fact (1st entry=headings, not counted in total number)
  31. 42 read a$,b$:c$="":a$=" "+a$:for k=1 to len(b$):a=asc(mid$(b$,k,1))
  32. 43 rem * convert fact to shifted/reversed characters
  33. 44 if a<32 or a>95 then a=160:goto 47
  34. 45 if a>63 then a=a+32:goto 47
  35. 46 a=a+128
  36. 47 c$=c$+chr$(a):next:b$="[160]"+c$+"[146]"
  37. 48 rem * print strings to screen and file ff$
  38. 49 print#2,a$z$b$:print ""fc$(2)a$"[146]"fc$(3)b$:next:next
  39. 50 close 2:print "";:end
  40. 97 rem *** data for quizzes ***
  41. 98 rem ** quiz #1
  42. 99 rem * number of entries, screen colors, foreground colors
  43. 100 data 10,0,4,7,8,"[154]","[144]","[154]",""
  44. 101 rem * quiz title (include 39 shifted characters, plus reverse on/off)
  45. 102 data "[160][160][160][160][160][160][160][160][160][160][160][160][198][201][210][211][212][160][212][197][211][212][160][209][213][201][218][160][160][160][160][160][160][160][160][160][160][160][160][146]"
  46. 103 rem * format/information line (39 unshifted characters, not reversed)
  47. 104 data "    just so you can see how it works   "
  48. 105 rem * column header for entries (21 shifted characters)
  49. 106 data "[160][211][193][205][208][204][197][160][197][206][212][210][201][197][211][160][160][160][160][160][160]"
  50. 107 rem * column header for facts (18 shifted characters)
  51. 108 data "[160][211][193][205][208][204][197][160][198][193][195][212][211][160][160][160][160][160]"
  52. 109 rem ** quiz items in correct order (20 char./entry, 17 shifted char./fact)
  53. 110 data "entry #1            ","fascinating fact!"
  54. 111 data "entry #2            ","fascinating fact!"
  55. 112 data "entry #3            ","fascinating fact!"
  56. 113 data "entry #4            ","fascinating fact!"
  57. 114 data "entry #5            ","fascinating fact!"
  58. 115 data "entry #6            ","fascinating fact!"
  59. 116 data "entry #7            ","fascinating fact!"
  60. 117 data "entry #8            ","fascinating fact!"
  61. 118 data "entry #9            ","fascinating fact!"
  62. 119 data "entry #10           ","fascinating fact!"
  63. 198 rem ** quiz #2 (just a sample)
  64. 199 rem * number of entries, screen colors, foreground colors
  65. 200 data 20,14,7,4,8,"","[144]","[144]",""
  66. 201 rem * quiz title (include 39 shifted characters, plus reverse on/off)
  67. 202 data "[160][160][160][160][160][160][160][160][160][208][204][193][195][197][211][160][215][197][160][200][193][214][197][160][204][201][214][197][196][160][160][160][160][160][160][160][160][160][160][146]"
  68. 203 rem * format/information line (39 unshifted characters, not reversed)
  69. 204 data " from the earliest to the most recent  "
  70. 205 rem * column header for entries (21 shifted characters)
  71. 206 data "[160][211][212][210][197][197][212][160][193][196][196][210][197][211][211][160][160][160][160][160][160]"
  72. 207 rem * column header for facts (18 shifted characters)
  73. 208 data "[160][195][201][212][217][160][193][206][196][160][211][212][193][212][197][160][160][160]"
  74. 209 rem ** quiz items in correct order (20 char. per entry, 17 char. per fact)
  75. 210 data "975 las palmas drive","santa clara^ ca  "
  76. 211 data "1425 e. dover street","mesa^ az         "
  77. 212 data "31 'l' street       ","salt lake city^ut"
  78. 213 data "117 'j' street      ","salt lake city^ut"
  79. 214 data "598 high ridge road ","sandy^ ut        "
  80. 215 data "370 south 650 east  ","orem^ ut         "
  81. 216 data "2314 miami blvd.    ","south bend^ in   "
  82. 217 data "5701 courtfield dr. ","goshen^ in       "
  83. 218 data "12 e. friendly      ","greensboro^ nc   "
  84. 219 data "box 33789^ hwy. 62  ","caswell^ nc      "
  85. 220 data "4704 penn wyne dr.  ","greenville^ sc   "
  86. 221 data "111 tradd street    ","charleston^ sc   "
  87. 222 data "17 meeting street   ","charleston^ sc   "
  88. 223 data "1490 seaview road   ","sullivan's isl^sc"
  89. 224 data "48 gramercy park so.","new york city^ ny"
  90. 225 data "599 park avenue     ","new york city^ ny"
  91. 226 data "midgeway farm       ","pea hollow^ tn   "
  92. 227 data "47 grace court      ","chevy chase^ md  "
  93. 228 data "990 north tallick   ","silver spring^ md"
  94. 229 data "12 saddleback trace ","buckle ridge^ wv "
  95. 230 rem this is the maximum number of entries possible in any quiz
  96. 231 rem notice that the ^ character is used for commas within entries.
  97. 232 rem 'the least and the most' changes this to a comma with custom characters
  98.